<template>
    <el-container>
        <el-header>
            <el-container>
                <SearchInput placeholder="请输入手机号" :change="(value)=>handleChange(value,'phone')" />
                <SearchButton :click="search" />
            </el-container>
        </el-header>
        <el-main>
            <el-table :data="tableData" stripe element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" v-loading.fullscreen.lock="loading">
                <el-table-column prop="mu" label="编号" min-width="108" />
                <el-table-column prop="phone" label="手机号码" min-width="108" />
                <el-table-column prop="username" label="登录账号" min-width="108" />
                <el-table-column prop="name" label="姓名" min-width="108" />
                <el-table-column prop="loginTimes" label="登录次数" min-width="80" />
                <el-table-column prop="lastloginTime" label="最后登录时间" min-width="108" />
                <el-table-column label="状态" width="80">
                    <template #={status}>
                        <AdminStatus :value="status" />
                    </template>
                </el-table-column>
                <el-table-column prop="ip" label="IP" min-width="108" />
                <el-table-column prop="createTime" label="注册时间" min-width="108" />
                <el-table-column label="操作" width="168">
                    <template #={mu,phone}>
                        <PlainButton text="关联" :click="()=>doRelate(mu,phone)" />
                    </template>
                </el-table-column>
            </el-table>
            <SearchPagination :currentPage="currentPage" :total="total" :limit="limit" @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange" />
        </el-main>
    </el-container>
</template>

<script>
import { page } from '@/chaos/functions/mixin/crud';
import AdminStatus from '@/app/components/AdminStatus';

export default {
    name: 'OpenAdmin',
    mixins: [page],
    components: { AdminStatus },
    data() {
        return {
            domain: 'chaos_admin'
        };
    },
    created() {
        this.search();
    },
    methods: {
        doRelate(mu, phone) {
            this.$router.push({
                name: 'relate',
                params: { mu, phone }
            });
        }
    }
};
</script>
<style lang="less" scoped>
</style>

